package com.lxs.mall.order.utils;


import com.lxs.common.constant.OrderConstant;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

@Component
public class OrderMsgProducer {
    @Autowired
    RocketMQTemplate rocketMQTemplate;
    public void sendOrderMsg(String orderSn){
        rocketMQTemplate.asyncSend(
                OrderConstant.ROCKETMQ_ORDER_TOPIC, MessageBuilder.withPayload(orderSn).build(),null,5000,4);
    }
}
